<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="crm.control.EmployeesControl"%>
<%@page import="crm.control.RecepitControl"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'TestJsp.jsp' starting page</title>
    <meta charset="utf-8">
	
	  <link type="text/css" href="../../../resources/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" />	
  <script type="text/javascript" src="../../../resources/js/jquery-1.6.2.min.js"></script>
  <script type="text/javascript" src="../../../resources/js/jquery-ui-1.8.16.custom.min.js"></script>
	
	
	
	<script>
		$(function() {
		$( "#findcustomer" ).autocomplete({
			source: function( request, response ) {
				$.ajax({
					url: "../recepit/auto_find_customer.jsp?term="+request.term,
					dataType: "json",
					success: function( data ) {
						response( $.map( data, function( item ) {
							return {
								td: item.name,
								value: item.name+"  "+item.business+" "+item.areaName,
								id:item.id
							}
						}));
					}
				});
			},
			select: function( event, ui ) {
				document.getElementById('consumer').value = ui.item.id;
			}
		});
	});
	</script>	
	
	

    
  </head>
  
  
  
  
  <body>
  <div class="demo">

<div class="ui-widget">

	<label ><br>Tag programming languages: </label>
	<input id="findcustomer" size="50" /><input type="hidden" id="consumer" name = "consumer">
	<label ><br>Tag programming languages: </label>
	<input id="tags2" size="50" />
</div>
</div>
  
  </body>
</html>
